package com.mayn.jst.erp.action;

import java.util.LinkedHashMap;

import com.jfinal.plugin.activerecord.Db;

/**
 * shop_myunion_fee 数据库操作类
 * 
 * @author Administrator
 *
 */
public class ShopMyunionFeeAction {

	public static Boolean save(int shopId, String date) {
		
		return false;
	}

	public static boolean checkIfExists(int shopId,String date) {
		String sql = "SELECT COUNT(*) FROM shop_myunion_fee WHERE SMF_SHOP_ID=? AND SMF_DATE=?";
		int c = Db.use("erp").queryLong(sql, shopId, date).intValue();
		if (c >= 1) {
			return true;
		}
		return false;
	}
	
	public Boolean savedata(LinkedHashMap<String,Object> map){
		
		String sql ="INSERT INTO `db-mayn-erp-prd`.`shop_myunion_fee` ( `SMF_CAMPAIGN_ID`, `SMF_CAMPAIGN_NAME`, `SMF_COMMISSION_RATE`, `SMF_TB_TRADE_PARENT_ID`, `SMF_TB_TRADEID`, `SMF_TB_AUCTION_TITLE`, `SMF_EARNING_TIME`, `SMF_TK_COMMISSION_FEE`, `SMF_NICK_NAME`, `SMF_TK_COMMISSION_RATE`, `SMF_TB_AUCTION_PRICE`, `SMF_TB_AUCTION_NUM`, `SMF_TK_PUB_ID`, `SMF_TB_FINISH_TOTAL_PRICE`, `SMF_TB_TRADE_CREATE_TIME`, `SMF_TB_TRADE_FINISH_TIME`, `SMF_FMT_COMMISSION_RATE`, `SMF_FMT_COMMISSION_FEE`, `SMF_FMT_AUCTION_PRICE`, `SMF_FMT_TB_FINISH_TOTAL_PRICE`)"
				+ " VALUES ("
				+ "" + map.get("SMF_CAMPAIGN_ID")
				+ " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);";
		
		Db.use("erp").update(sql);
		
		return false;
	}
}	
